package cn.wsw.hrm.client;

import cn.wsw.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "HRM-REDIS",configuration = FeignClientsConfiguration.class,
        fallbackFactory = RedisClientFallbackFactory.class )//服务提供者的名称
@RequestMapping("/cache")
public interface RedisClient {
    @PostMapping
    AjaxResult add(@RequestParam(value = "key",required = true) String key,@RequestParam(value = "value",required = true) String value);
    @PutMapping
    AjaxResult addForTime(@RequestParam(value = "key",required = true) String key
            ,@RequestParam(value = "value",required = true) String value,@RequestParam(value = "time",required = true)Integer time);
//    @DeleteMapping
//    AjaxResult del(@RequestParam(value = "key",required = true) String key);
    @GetMapping
    String get(@RequestParam(value = "key",required = true) String key);
}
